package database;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.naming.spi.DirStateFactory.Result;

public class HrUser {
	public static void main(String[] args) {
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			System.out.println("dirver loaded!");
			
			Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","hr","hr");
			System.out.println("connected!");
			
			//String update="update jobs set job_id=? where job_id=?";
			String delete="delete from jobs where job_id=?";
			//String insert="insert into jobs values(?,?,?,?)";
			//String select="select * from employees where first_name like ? and salary>?";
			//PreparedStatement pstm=conn.prepareStatement(select);
			
			PreparedStatement pstm=conn.prepareStatement(delete);
			
			pstm.setString(1, "IT_JAVA");
			//pstm.setString(2, "IT");
		    pstm.executeQuery();
			
			/*while(rs.next()){
				System.out.println(rs.getString("first_name") + "\t" + rs.getInt("salary"));
			}*/
			
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
